package com.net.shop.car.manager.api.volley.response.oil;

import java.util.ArrayList;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.net.shop.car.manager.api.volley.Response;
import com.net.shop.car.manager.utils.Constants;

public class OilHuaBoResponse extends Response{
	public Card card;
	public String Content;
	public ArrayList<Detail> list;
	public OilHuaBoResponse() {
		super(Constants.HUA_BO);
		
	}
	@Override
	public String getContentTag() {
		return "info";
	}
	
	public void parseContent(String content) {
		JSONObject jd;
		Content=content;
		System.out.println("============content  "+content);
		card=new Card();
		list=new ArrayList<Detail>();
		try {
			JSONArray array=new JSONArray(content);
			JSONObject jo=(JSONObject) array.get(0);
			jd=jo.getJSONObject("card");
			card.Monney=jd.getString("SET_MONEY");
			card.Date=jd.getString("DAO_KUAN_DATE");
			card.Times=jd.getString("TYPE");
			array=jo.getJSONArray("detial");
			int lenth=array.length();
			for(int i=0;i<lenth;i++){
				Detail detail=new Detail();
				jd=array.getJSONObject(i);
				detail.Date=jd.getString("HUABO_DATE");
				System.out.println("___________日期"+detail.Date);
				
				detail.Monney=jd.getString("HUABO_MONEY");
				detail.PiCi=jd.getString("PI_CI");
				list.add(detail);
			}
			System.out.println("——————————————————————次数    "+lenth);
		} catch (JSONException e) {
			e.printStackTrace();
		}
		
	}
	public class Card{
		public String Date;
		public String Taocan;
		public String Monney;
		public String Times;
	}
	
	public class Detail{
		public String Date;
		public String PiCi;
		public String Monney;
		
	}

}
